/*
 * package.h
 *
 *  Created on: Jan 17, 2016
 *      Author: root
 */

#ifndef PACKAGE_H_
#define PACKAGE_H_

namespace dounine_package{//define namespace

	/**
	 *process local package
	 */
	bool process_packet(unsigned char* , int);

	/**
	 *
	 */
	unsigned short csum(unsigned short * , int );

	/**
	 * hostname convert to ip
	 */
	char * hostname_to_ip(char * );

	/**
	 * get local ip address Example:192.168.1.100
	 */
	void get_local_ip (char *);

	/**
	 * read syn callback package
	 */
	void read_syn_ack ();

	/**
	 * send syn package
	 */
	void send_syn_package(const string& ip,const string& source_ip,const int port);

}

#endif /* PACKAGE_H_ */
